#ifndef __IPC_TYPEDEF_H__
#define __IPC_TYPEDEF_H__

#include <stddef.h>
#include <stdlib.h>		//malloc free
#include <string.h>		//memset

typedef enum
{
	ipcSuccess = 0,
	ipcErrorInvalidPara = 1,
	ipcErrorMalloc = 2,
	ipcErrorNotFound = 3,
	ipcErrorSyscall = 4,
	ipcErrorTimeout = 5,
	ipcErrorEntryUseOut = 6,
	ipcErrorDisconnect = 7,
	ipcErrorMisc = 63,
}ipcRet_e;

typedef char int8;
typedef short int16;
typedef int int32;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;

#define BUF_LEN_16 (16)
#define BUF_LEN_64 (64)
#define BUF_LEN_1024 (1024)

#define FILE_SIZE_64K (1024*64)

#define ARRAY_LEN_16 (16)
#define ARRAY_LEN_64 (64)

#ifndef TRUE 
#define TRUE (1)
#endif

#ifndef FALSE 
#define FALSE (0)
#endif

#define FREE_PTR_AND_NULL_IT(ptr) 		do{if(NULL!=ptr){free(ptr),ptr = NULL;}}while(0);
#define PUT_ZERO_2_MEMORY(ptr,size)		do{memset(ptr,0,size);}while(0);

#define IPC_INVALID_FD (-1)

#endif